package com.big.merchan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.big.merchan.mapper.MerchandisePackageMapper;
import com.big.merchan.service.MerchandisePackageService;
import com.big.model.model.merchandise.MerchandisePackage;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class MerchandisePackageServiceImpl extends ServiceImpl<MerchandisePackageMapper, MerchandisePackage>  implements MerchandisePackageService {


    /**
     * 规格组
      * @param mId
     * @return
     */
    @Override
    public List<MerchandisePackage> packages(String mId) {

        QueryWrapper<MerchandisePackage>queryWrapper=new QueryWrapper<>();
        if(!StringUtils.isEmpty(mId)){
             queryWrapper.eq("m_id",mId);
        }
        List<MerchandisePackage> merchandisePackages = baseMapper.selectList(queryWrapper);
        return merchandisePackages;
    }
}
